﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KPIS.GERP.GFMS.MODEL;
using KPIS.GERP.GFMS.IBLL;
using KPIS.GERP.GFMS.IDAL;
using KPIS.GERP.GFMS.DALFactory;

// test only
using KPIS.GERP.GFMS.DAL;

namespace KPIS.GERP.GFMS.BLL
{
    public class B_HRM_WF_Finances : IBLL_HRM_WF_Finances
    {
        Common common = new Common();
        private static readonly IDAL_HRM_WF_Finances dal = DataAccess.Create_HRM_WF_Finances();
        //IBLL_HRM_PR_PayrollDtls r = new B_HRM_PR_PayrollDtls();

        public B_HRM_WF_Finances()
        {

        }

        public IList<M_HRM_WF_Finances> GetFull()
        {
            return dal.GetFull();
        }

        public M_HRM_WF_Finances GetInfo(string seq)
        {
            int nSeq;
 
            if (seq == null)
                return null;

            if (common.IsNumeric(seq))
            {
                nSeq = int.Parse(seq);
                return dal.GetInfo(nSeq);
            }
            else
            {
                return null;
            }
        }

        public void Update(M_HRM_WF_Finances info)
        {
            try
            {
                dal.Update(info);
            }
            catch
            {
                throw;
            }
        }

        public void Delete(string strFinanceSeq)
        {
            dal.Delete(strFinanceSeq);
        }
    }
}
